import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///缩放比例
const ratioValue = 2;

///设置屏幕尺寸
void setScreen(BuildContext context) {
  ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);
}

///缩放后的尺寸
setTextSp(double sp) => ScreenUtil.getInstance().setSp(sp) * ratioValue;

setRatio(double value) => _setWidth(value) > _setHeight(value)
    ? _setHeight(value) * ratioValue
    : _setWidth(value) * ratioValue;

///缩放后的尺寸
_setWidth(double width) => ScreenUtil.getInstance().setWidth(width);

///缩放后的尺寸
_setHeight(double height) => ScreenUtil.getInstance().setHeight(height);
